package com.ruoyi;


public class Test {
    public static void main(String[] args) {
        byte btSum = 0x00;
        byte[] bytes = {(byte)0xa0,(byte)0x04,(byte)0xff,(byte)0x89,(byte)0xff};

        for (int i = 0;  i < bytes.length; i++ )
        {
            btSum += bytes[i];
        }
        byte result = (byte) (((~btSum) + 1) & 0xFF);
        System.out.println(result);
    }
}
